﻿
#include <iostream>
#include <functional>
#include "core.cpp"
#include "json_test.cpp"
#include "xudp.cpp"

void func(const string& key, shared_ptr<h::share_data> s_data)
{
	while (true)
	{
		unique_lock<mutex> lck(*(s_data->pmtx));
		s_data->pcv->wait(lck);
		if (s_data->exit)
		{
			std::cout << key << " 线程退出 " << std::endl;
			break;
		}
		std::cout << key << " Sub Work : " << s_data->time << std::endl;
	}
}

int main()
{
	h::xudp::run();
	return 0;

	return 0;
	h::json_test();
	std::cin;
	return 0;

	h::core c;
	c.run();
	char cmd[50];
	c.addthread("线程1", func);
	c.addthread("线程2", func);
	c.addthread("线程3", func);
	while (true)
	{
		std::cin >> cmd;
		switch (cmd[0])
		{
		case 'e':
			c.stop_main();
			break;
		case 'p':
			c.pause_main();
			break;
		case 'c':
			c.continue_main();
			break;
		case 'r':
			c.run();
			break;
		case 'q':
			break;
		default:
			break;
		}
	}
	std::cout << "进程退出\n";
	std::cin >> cmd;
}

